<?php
class UserGroup extends Eloquent {

    protected $table = 'users_groups';
    
    /**
     * Get group
     * @author Duc Nguyen
     */
    public function getFirstGroup($user_id) {
    	$firstGroup = $this->where('user_id', '=', $user_id)->first();
    	if (count($firstGroup) > 0) {
    		return $firstGroup->group_id;
    	}
    	return 100; // No group
    }
    
}